// 搭建 express 服务
const express = require('express');
const app = express();
// post请求表单数据
app.use(express.urlencoded({extended:true}))

// 资源共享
// const cors = require('cors');
// app.use(cors());

// 静态资源托管   ----- 访问 http:localhost:8989/图片.jpg
app.use(express.static('upload'));

// 路由
const router = require('./router');

// 订单
const order = require('./order');
// 广告
//const advert = require('./advert')

app.use('/order',order);
app.use('/',router);

//app.use('/advert',advert);


app.listen(9898,()=>{
  console.log(9898);
})
